<tagLib name="html" />
{$header}
<div id="main" class="main" >
<!-- 主体内容  -->
<div class="content" >
<div class="btn-toolbar">
	<div class="btn-group">
<button class="btn btn-primary" onclick="edit()"><i class="icon-edit icon-white"></i> 编辑</button>
<button class="btn btn-primary" onclick="foreverdel()"><i class="icon-trash icon-white"></i> 删除</button>
</div>
<form class="search-form pull-right" method='post' action="__URL__">
		<input type="text" class="search-query span4" name="keywords" <notempty name='_REQUEST.keywords'>
		<php>echo 'value="'.urldecode($_REQUEST['keywords']).'"'</php>
		<else/>
		placeholder="按产品，销售单号或条码搜索"
	</notempty>
	>
	<input type="submit" class="btn btn-primary" value="搜索"></form>
	<form class="search-form pull-right" method='get' action="__URL__">
		<select name="customer_id" class="span2">
			<option value="0">客户</option>
			<volist name="customers" id="co">
				<option value="{$co.id}">{$co.name}</option>
			</volist>
		</select>
	<input type="submit" class="btn btn-primary" value="搜客户"></form>
	<form class="search-form pull-right" method='get' action="__URL__">
		<select name="user_id" class="span2">
			<option value="0">经办人</option>
			<volist name="users" id="uo">
				<option value="{$uo.id}">{$uo.name}</option>
			</volist>
		</select>
	<input type="submit" class="btn btn-primary" value="搜经办人"></form>
</div>
<!-- 功能组区域结束 -->
<php>
    function getHouse($enter_id){
        return getModelName(getModelName($enter_id,'Sale','warehouse_id'),'Warehouse');
    }
</php>
<!-- 列表显示区域  -->
<div class="list" >
	<notempty name="_REQUEST.sale_id">
    <php>
      $eid = $_REQUEST['sale_id'];
      $enter = M('Sale');
      $enter->getById($eid);
      $total_number = M('Sale_detail')->where('sale_id = '.$eid)->sum('number');
      $enter_no = $enter->sale_no;
      $total = $enter->total;
      $customer = $enter->customer_id;
      $user_id = $enter->user_id;
      $create_time = $enter->create_time;
    </php>
  <p class="h4 span12 alert-info alert"><strong>销售单号:</strong> {$enter_no}  <strong>总数量</strong>: {$total_number}  <strong>总金额：</strong>{$total}元   <strong>客户:</strong>{$customer|getModelName="Customer"}    <strong>经办人：</strong>{$user_id|getModelName="User"}    <strong>销售时间:</strong>{$create_time|toDate}
  </p> 
  </notempty>
<div id="result" class="result none"></div><html:list id="checkList" style="table table-bordered table-striped" name="action" checkbox="true" action="true" datasource="list" pk="did" show="did:编号|3%:edit,sale_no:销售单号,name:产品,price:售价,number:数量,dtotal:总金额,customer:客户,wname:仓库,pid|getDStock:库存,dctime|toDate:创建时间,user_id|getModelName=User:经办人" actionlist="edit:详情:did" />
</div>
<!--  分页显示区域 -->
<div class="page">{$page}</div>
<!-- 列表显示区域结束 -->
</div>
<!-- 主体内容结束 -->
</div>
<!-- 主页面结束 --><include file="Public:footer"/>

